using System;

using EntLibEC.Cmn;

namespace EntLibEC.Info.Basic
{
	/// <summary>
	/// Summary description for Category3Info.
	/// </summary>
	public class Category3Info : IComparable
	{
		public Category3Info()
		{
			Init();
		}

		private int _sysno;
		private int _c2sysno;
		private string _c3id;
		private string _c3name;
		private int _status;
		private int _SearchByAttribute;
		private string _c3Bulletin;

		public void Init()
		{
			_sysno = AppConst.IntNull;
			_c2sysno = AppConst.IntNull;
			_c3id = AppConst.StringNull;
			_c3name = AppConst.StringNull;
			_status = AppConst.IntNull;
			_SearchByAttribute = AppConst.IntNull;
			_c3Bulletin = AppConst.StringNull;
		}

		public int SysNo
		{
			get
			{
				return _sysno;
			}
			set
			{
				_sysno = value;
			}
		}
		public int C2SysNo
		{
			get
			{
				return _c2sysno;
			}
			set
			{
				_c2sysno = value;
			}
		}
		public string C3ID
		{
			get
			{
				return _c3id;
			}
			set
			{
				_c3id = value;
			}
		}
		public string C3Name
		{
			get
			{
				return _c3name;
			}
			set
			{
				_c3name = value;
			}
		}
		public int Status
		{
			get
			{
				return _status;
			}
			set
			{
				_status = value;
			}
		}
		public int SearchByAttribute
		{
			get
			{
				return _SearchByAttribute;
			}
			set
			{
				_SearchByAttribute = value;
			}
		}

		public string C3Bulletin
		{
			get
			{
				return _c3Bulletin;
			}
			set
			{
				_c3Bulletin = value;
			}
		}

		public override string ToString()
		{
			string temp = "[" + this._c3id +"] " + this._c3name;
			if ( this.Status == -1) //appenum.bistatus.invalid
				temp += "(*)";
			return temp;
		}

		#region IComparable Members

		public int CompareTo(object obj)
		{
			Category3Info b = obj as Category3Info;

			if ( this.Status < b.Status )
				return 1;
			else if ( this.Status > b.Status )
				return -1;
			else
			{
				int result = String.Compare(this.C3ID, b.C3ID);
				if ( result > 0)
					return 1;
				else
					return -1;
			}
		}

		#endregion
	}
}
